package cn.terminus.service.customer.kafka;

import cn.terminus.result.common.context.TerminusCallContext;
import cn.terminus.result.common.util.TerminusDateUtils;
import lombok.Data;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.math.BigDecimal;

@Data
public class KafkaContractParam extends StatisticsBase {
    protected static final Logger logger = LoggerFactory.getLogger(KafkaContractParam.class);
    /**
     * 园区ID
     */
    private Long cboProjectId;
    /**
     * 租售类型
     */
    private String cboProjectRoomresSale;
    /**
     * 房间id
     */
    private Long roomId;
    /**
     * 累计数量
     */
    private Integer totalNum;
    /**
     * 累计面积
     */
    private BigDecimal totalArea;
    /**
     * 新增数量
     */
    private Integer addNum;
    /**
     * 新增面积
     */
    private BigDecimal addArea;
    /**
     * 操作code
     */
    private int code;

    /**
     * 渠道联系人ID
     */
    private Long channelPersonId;


    public static KafkaContractParam setContractMessage(TerminusCallContext context, Long cboProjectId,
                                                        String cboProjectRoomresSale, Long roomId, Integer totalNum,
                                                        Integer addNum, int code ,Long channelPersonId) {
        KafkaContractParam contractParam = new KafkaContractParam();
        contractParam.setAddNum(addNum);
        contractParam.setTotalNum(totalNum);
        contractParam.setBusinessId(context.getBusiness().getBusinessId());
        contractParam.setCboProjectRoomresSale(cboProjectRoomresSale);
        contractParam.setDataTime(TerminusDateUtils.getDate10YMD());
        contractParam.setRoomId(roomId);
        contractParam.setCboProjectId(cboProjectId);
//        contractParam.setAddArea(addArea);
//        contractParam.setTotalArea(totalArea);
        contractParam.setCode(code);
        contractParam.setChannelPersonId(channelPersonId);
        logger.info("contractParam={}"+contractParam);
        return contractParam;
    }
}
